rate-limit the glyph cache dumping
authorMatthias Clasen <mclasen@redhat.com>
Mon, 11 Sep 2017 15:15:00 +0000 (11:15 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 11 Sep 2017 15:15:00 +0000 (11:15 -0400)
Writing the file out every frame really isn't necessary.
Do it once per second.

gsk/gskvulkanrenderer.c

index 39313cdaf9867e6f4d296ead0cd767333024c892..109f487f1d635f7fa5bda8aeb21d2328417cee36 100644 (file)
@@ -642,10 +642,18 @@ dump_glyph_cache_stats (GlyphCache *cache)
 {
   GHashTableIter iter;
   FontEntry *fe;
+  static gint64 time;
+  gint64 now;
 
   if (!cache->fonts)
     return;
 
+  now = g_get_monotonic_time ();
+  if (now - time < 1000000)
+    return;
+
+  time = now;
+
   g_print ("Glyph cache:\n");
   g_hash_table_iter_init (&iter, cache->fonts);
   while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&fe))